﻿using LearnMAUI2.Models;
using System.Linq.Expressions;

namespace LearnMAUI2.Services;

//copy代码，而不要引用文件
public interface IPoetryStorage
{
    //用于判断数据库是否初始化
    bool IsInitialized { get; }

    //初始化，拷贝文件
    Task InitializeAsync();

    Task<Poetry> GetPoetryAsync(int id);

    /// <summary>
    /// 执行相当于SQL的where查询
    /// </summary>
    /// <param name="where">SQL where</param>
    /// <param name="skip">跳过</param>
    /// <param name="take">获取</param>
    /// <returns></returns>
    Task<IEnumerable<Poetry>> GetPoetriesAsync(Expression<Func<Poetry, bool>> where, int skip, int take);

}
